Added Jasmine tests. Fixes #2