Modified the way function thunks are generated so that it's no longer dependent on the order classes got loaded, which has the potential to change depending on which map was loaded.