Added karma support.
Implemented some unit tests.