Improve code coverage and interface

Adds a lein plugin, fixes multiple bugs, better coverage.