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

...ient and AdaGrad
@leelurch you're right that `unique_ptr` would be better, but I think c++11 is incompatible with NVCC (CUDA compiler).  Not sure though, someone more informed should comment.