Updated prepareExports with correct module loader

Fixed usage of require vs define.