start refactor test.js
javascript test refactor
refactor and harden javascript test suite