Checking for AMD before CommonJS in UMD wrapper now. CommonJS returns module value, NOT factory function