Change the detection of RequireJS.

We cannot rely on testing for "module". The "module" name is also
registered by angular-mocks, causing this to break.