improved testability
added karma dependancies and updated tests