ported tests to mocha and run in karma