REF: make Grouping less stateful
This gets rid of _make_codes, which sets two state variables, in favor of a cache_readonly _codes_and_uniques
sure, not sure if need to rebase as merged a couple of other refactors but prob can't hurt rebased + green