more test coverage, added karma and removed more boilerplate