Add support for up to 10 parameters in autodiff. Supporting only 6 parameters in autodiff was enough for most cases, but 6 was not always sufficient. This extends the current implementation to work with up to 10 parameters. This also increases the number of parameters supported in SizedCostFunction to 10. Change-Id: Ic783602f93e6ddf4af24fa34eff37c0a4b775dc1