Fixes #4.

See #4.

This moves the utility functions out of the base directory into a `cmtutil` class. If we don't like the name, we can always change it later.