added Karma and some tests