finally fix regulus transformation matrix

also some miscellaneous cleanups (remove debug prints, more utility functions,
etc)