check if module.exports exists first

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