Added more mocha tests and karma tests