Essentially the same thing as !3427 (merged) - switching module attributes to private functions to prevent a compile dep.
Removes a cycle and shrinks others: https://www.diffchecker.com/J8Md7SaV
Note that while this appears to remove the same cycle as !3459 (merged), it will actually remove an additional cycle when both are merged.