Tweaked implementation of Trie[] for concision
Added SortedSet#group_by