Add unit tests
Add istanbul code coverage
Clean up API