[mr3143] Rework TargetedMGen, attempt II. Make templates ISO compatible.