Add support for self.exports in worker code

If self.exports is defined, enumerate that instead of self itself