Add tests.  I don't see any easy way to test main() right now :(
Merge branch 'v1'