Work on hypermath.h

Needs testing. Really. Most of the code has never been run.