Added a few tests, finished javascript file