Support either AMD or CommonJS by using UMD returnExports

Fixes #9