check if module.exports exists first to fix issue with Browserify and requirejs