Use the same initialization/cleanup scheme for JIT and AOT.  Initialize
imported modules at the point where they are imported instead of prior to
execution of the importing module's main.