group By Block
Logic for grouping buffered items into groups, keyed off of the MapKeyType. Everything that is buffered will eventually make its way into the map. In order to know what key to use in the map, everything in the buffer is grouped according to this function.