added bits of JS and tests in mainWhite.js
following the merge of mainWhite.js