added package.json and tests to run in the node.js environment as well as the browser