Adding npm packaging to support browserify.

I'm using d3 with browserify and started using your package. Since I'm building my project with browserify I improved this package's compatibility.
You should publish this package to npm, if you prefer I'll do it myself.