Internally flatten out nested iterables.

def flatten(self):
    """Internally flatten out nested iterables."""
    return PhaseGroup(
        setup=flatten_phases_and_groups(self.setup),
        main=flatten_phases_and_groups(self.main),
        teardown=flatten_phases_and_groups(self.teardown),
        name=self.name)