added NaN test for Phi
added NaN testing framework for agrad/rev/functions
updated NaN testing framework for Phi
added nan doc to manual for derivative of Phi