First work at factoring out AdaGrad and adding AdaDelta as an option.