MDL-37538 Improve module metadata generation for modules with subtypes

This change will require third-party modules defining subtypes to
additionally define their subtype in the MODNAME_get_types() function.

Such modules do not have to remove or modify their existing $type->type
definition so they should be able to continue to offer a shared code-base
for multiple versions.
MDL-37538 backward compartibility in modules with subtypes