Add cli and browserify support

Some funky module.exports being a function with properties, but otherwise pretty standard stuff.