makes the script browser-ready

minor changes that will allow the script to run from a browser with no modifications. Also adds a browser base mocha test-runner.

it would be really great if your code could be made available via bower!