SI-7148 don't optimize impl classes away in parser

That's not a proper fix, since it removes the optimization altogether
instead of doing it later.
change the signature of addSyntheticMethods
remember templates and their contexts
calculate selfType directly in validateParentClasses
move calculation of synthetic ModuleDef parents into typedParentTypes
refactors typedTemplate
c.introduceMember