Migrate the code to insert module initFn from scopeResolve to docs.  Almost home.