Added minimize and maximise methods for performing unconstrained
nonlinear optimization using the BFGS algorithm. Based on the
implementation found in scipy.optimize.