Cleaned up groupBy iter implementation.