diff/fd: implement Hessian finite difference, and code cleanups.
Created by: btracey
This commit primarily adds the Hessian function for finding a finite difference approximation to the Hessian. At the same time, it combines duplicated functionality across the difference routines so that the preludes to all the difference routines look similar