Modernize and cleanup the ChainGroup code (e.g. use range-based for-loops). No functional changes.
ChainGroup