UMD style for loading dependencies

UMD style fixes problems with some AMD loaders. Based on https://github.com/umdjs/umd/blob/master/returnExports.js