Port old JS Spec tests to Mocha

Two changes:

 - Port old JS Spec tests to Mocha
 - Fix a bug that i noticed while porting the tests