put the AMD definitions before CommonJS

Some build tools expose an `exports` object.  UMDs that check for `exports` first will cause those build tools to error out.