This enables general templating capabilities, in addition to environment variable access. Closes #3974.
This breaks the old grouping mechanism, but honestly that was a weird way of doing it.