Fixed some broken things. Added JS test suite.