Fixed module check

The module check was inaccurate - the existential operator in Coffeescript (`?`) will return true if the value is anything other than `null` or `undefined`. This means `hasModule?` will return true, even if `hasModule === false`.

I also removed the `typeof` checks in the `hasModule` definition - that's what the existential operator is good at :)