using correct undefined check for global module variable

Without this change, browsers (such as chrome) raise a ReferenceError on this line.

```
Uncaught ReferenceError: module is not defined browser.js:552
(anonymous function)
```

An alternative fix would be
```
if (window.module && module.exports) {
    module.exports = hawk;
}
```