Make sure record order is preserved in output JS and add missing code to generated function that skips objects added to Object prototype when executing preload functions.