Significant module export refactoring (not yet complete)