More refinement, including changing types to typedefs where appropriate. Added cmath functions needed.  Still some Chris TODOs near end.

svn path=/sandbox/; revision=83545