Merged NewtonSolver to CodeGenerator