Fix logging and emit an event for tests to listen to
Add test deps
Add tests
ignore coverage and switch to running tests with istanbul