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

...ient and AdaGrad
Note that if a template function is defined in the header file, you won't need the above two lines.