Update unit tests, and add karma.config.js so that Karma can be used as test runner.