Add unique IDs to groupings.
Add grouping identifiers to selectors.