Added Karma tests and a test factory for creating and manipulating objects