Don't export global var if amd succeeds.

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