Instead of using this hack with the modified template name (e.g. `p3&foo`) everywhere, now EntityGroups uses this "extended" template name only internally as key to sort by owner and template. So nothing besides EntityGroups needs to know about how this key is constructed.
Fixes #4425. refs #1807, #4167.