More re-arrangement and addition of explanatory text.
Clean up which still compiles but generates a run-time error becuase
the data doesn't match the "matrix" size hard-coded in the original
code but which can be replaced by something which is generated by the
data and therefore should not produce the error.
Start of automated differentation. Sadly we currently have to write
the implementation of the evaluation function ourselves without using
hmatrix as the ad package won't play with it.