Added js tests, using jasmine and sinon