Refactor. Add test suite. Bump to v0.1.0.