Abstract out post-registration handling of pre-registered modules.
Add table.clear().
Merge branch 'v2.1' into v2.1-agentzh