Separate Hessian testing function

Slight rewrite of the numeric Hessian calculation so that is may be
called with "ideal", "res" or "rk" flag to calculate the ideal Hessian,
residual Hessian and actual Hessian, respectively.

This is used in the hessianTesting.jl-script, which evaluates each of
the three using both analytic and numeric results - and then compares
the two.