Extract method populate_groupings from retrieve_data
retrieve_data was still doing too much: creating the
grouping objects and populating them with the cell data.
Here we extract the populating part to its own method,
and add significant unit tests for it.