That is, the generated declare_modules() function registers the module-declaration code so that it is run in any new place, too. Merge to 5.2.1
Also, fix test to that it DrDr will run it.