Requirejs fixes and client test file

Incorporating changes from @adamhooper and adding a very rudimentary client side test file .