Refactor internal state handling to support autodiff
Moves all state variables into specialized state type CryoGridState
which is handled by the solver.
This enables seemless integration with autodiff tools at the cost of performance due to more state variables being copied.
This could be mitigated somewhat in the future by being "smarter" in CryoGridState
about which arrays to copy the data and which to copy just the reference.
Also adds support for specifying Jacobian (tridiagonal) sparsity in CryoGridProblem which speeds up stiff solvers by 1-2 orders of magnitude.
Edited by Brian Groenke