Tidy up the PetscNonlinearSolver class

* making data members protected (to allow derived classes to access them)
* adding getters
* making callbacks friend with the class