Adding self-executing function and type checks to support client-side use

This diff looks bad but it's mostly spacing - I moved virtually the whole thing into a self-executing function, added a typeof check for module before accessing .exports, and moved the reset function to be accessed via seedRandom instead of module.exports.  Assuming running node index.js in the test directory is actually running the tests, they all still pass.  I am not totally sure how to use travis to check whatever else needs checking.