try out mocha
fix ending events, automate tests