Refactored function for jacobian calculation.
Changed model format to allow working with numba as a jit