Added tests. Fixed few minor issues found while writing tests.

Added tests. Fixed few minor issues found while writing tests.
Fixes #5 
I don't think this is worthy of a CHANGELOG entry.

But even if it was, if you want to keep a running CHANGELOG before a version bump, you should use something like `## DEV` instead of assuming the next version will be `0.0.2`.