Don't export global var if amd succeeds.

Following AMD pattern via https://github.com/umdjs/umd/blob/master/returnExports.js