Made the compiled versions compatible with CommonJS, AMD, and browser via a UMD-like pattern. Added tests for exports.