code: def _rebuild_groups(self):
          
          self.groups = []
          
          def collapse_group(group):
              for subgroup in group.children:
                  self.groups.append(subgroup)
                  collapse_group(subgroup)
                  
          collapse_group(self.root)
docs: Recreates the groups master list based on the groups hierarchy (order matters here,
          since the parser uses order to determine lineage).