Generate MetaTypes in pluginGenerator. (Major refactoring done too).