Tidy ncobj.grouping, neater 'complete' implementation (still untested!).