More flexible UMD for CommonJS

Resolves gh-2