Fixed #3: Better export

The types function is now only exposed to the global scope if it hasn't been exported through module.exports or the define method before.