Refactor

* Use `test-framework` option
* Added tests
* Code style

Fixes #8.