Give priority to AMD detection

If one is using an environment like [App.js](http://appjs.org/) with an AMD loaded (e.g. RequireJS), both `module` and `define` variables are set.

In this case, one should give priority to `AMD` detection, because `node` is only being used as a way spawn a webkit in a window (among other things).