Add initial AdaGrad implementation.
Support arbitrary loss function.
Remove needless stuff.
Fix bug and add tests.
Correct implementation in the sparse case.