Fixed conjugate gradient search

Modified conjugate gradient code to use Nonlinear Conjugate Gradients with Newton-Raphson and Fletcher-Reeves, as described in sec B4 of Jonathon Shewchuk's "An introduction to the Conjugate Gradient Method Without the Agonizing Pain".

Made CG ascent primary, getting rid of double negation.
Added doctests
Merge pull request #27 from cscherrer/master

Fixed conjugate gradient search