export: fix require() issue with component.io

When using require('hammerjs') together with component.io, require()
returns an empty object because it thinks that the 'module' variable
should be an object, but it's actually a function.

This patch fix that problem by checking that 'module' is different
from undefined rather than checking it's an object.

Same thing used in underscorejs :

https://github.com/jashkenas/underscore/blob/master/underscore.js#L45