Wrap in module pattern and add package.json

* Wrap factory in module pattern so it can be used in webpack/browserify/require-js and stuff.
* Added a package.json