Generic unconstrained optimization framework. Supports custom linear-algebra backends, as well as custom directions/stopping criterions