=act, rem, clu #3521: make serialize-messages work with core modules
(cherry picked from commit b566e93)
Merge pull request #1690 from drewhk/wip-3521-backport-drewhk

=act, rem, clu #3521: make serialize-messages work with core modules (backport)