refactored mocking library, karma + simple test added