Nesterov momentum

Sorry for the time I took, after my problem with the rebase I figured I might just start from scratch and make separate pull requests for nesterov momentum and search direction.

This pull request is about Nesterov momentum, and hopefully everything is alright.