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



This is dangerous advise: enabling Erlang views creates potential RCE issue. Could it possible to count `'should apply a query in erlang also'` failure as non critical?