redo all the tests using mocha and clean up a bit