Clean up module setup code to avoid C globals.