Refactor residual and jacobian in specmicp
The residuals_ and jacobian_ member functions are changed to call helper functions. The code is thus shared and it should help to reduce the errors.