Inline the ModuleRegistry impl so we don't have to widen its API for the internal protocol.