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

...ient and AdaGrad
Please use the `shared_ptr` constructor:

```
 shared_ptr<Solver<float> > solver(GetSolver<float>(solver_param));
```

(I didn't try compiling this, but I think it should work -- let me know if it doesn't and you can't figure out how to fix it.)