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).
Next day you require `escape-string-regexp` for whatever reason and all these lines will need to be changed again. Doesn't it confront the stated purpose of the patch?