[3.8] Fix #1190 Use phantom JS to run qunit tests

- [x] Use a single file to run all JS tests
- [x] Fix failing tests