added jasmine test files, some refactoring