initial work on supporting loop generation for the hessian; 
other minor fixes/improvements in the jacobian loop generation
improved test for loop detection;
changed some headers define names in the test folder