move patch hook to after core modules are attached

This hook needs to happen earlier if we want to capture all the work
that loader does when it is instantiated.