Fixed exporting the object and whitespace

Hey there. 

This change includes a bunch of whitespace fixes, as well as a change to how the CommonJS module is exported. I'm not sure how long this has been broken for, but it now works as detailed in the README, and all the tests now pass.