[v9.x backport] module: main w/o extension, pjson cache (#18728, #18788)
This includes the v9 backports for #18728 and #18788.
The conflict resolution is only in the first commit for #18728 here.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines