Jac testing

Adds a simple regression test to the Jacobian demos. Return 0 if passed or 1 if failed.