Added karma unit testing and altered structure to support testing.