Completed Newton-Raphson solver; edited a few const issues. Had to use const_cast and break constness in a few instances