refactored browsertest.js to be more modular