Add "main" key to package.json to make it npm installable
Use 'window' instead of 'this' to support browserify
Bump to v0.3.1