Convert the ObjectGroup trait into a class and implement Iterable

You can't have traits that implement interfaces so this needed to be
a class. Though, in all fairness, this should probably be fine.