Reworked projecting of templates on RHS, templates no longer need to
correspond to a top-level grammar rule.