Prep for unit testing
Fixes #4
Experimenting with nicer error messages