New "private" module for helper functions for miraw.
Minor corrections in comments.
Refactored helper code; improved test suite; bugfixes.