More flexible UMD for CommonJS

Resolves gh-4