Testing

* Refactoring for testability
* Unit-testing with `testing` package
* Continuous-Integration using Wercker