Solver switching support & implementation of Nesterov's accelerated grad...

...ient and AdaGrad
I don't know about boost::variant, but it seems like `shared_ptr<Solver<float> > solver(GetSolver<float>(solver_param));` would work just fine (and is probably a bit more consistent with the rest of the codebase).