Added some more tests
Added some tests, made javascripts "testable"