Update UMD wrapper for all modules
- put the AMD definitions before commonjs
- based on https://github.com/umdjs/umd/commit/992cc0d071b7ebcd7feaad2a5349bdbeab09a0fe