Reorganized code to make patching easier

I reorganized the source so that the exported module has all of its functions as attributes, rather than have them  wrapped in a closure. This makes it easier to monkeypatch the code downstream, which I need to do to handle the case when the package.json file has dependencies without any exported JS code (as is the case with things like Font Awesome and PureCSS in NPM).