Fixed unit test; it all actually works. Added a README for running the tests with karma/jasmine.