code reorg, lots of bug fixes

more to come, getSphereSurfaceArea and the quadruple prime functions are
still broken