Add cases to rigidify

It now can handle all trees with at least four elements. We don't
currently use it so flexibly, but leaving those unmatched cases
around seemed sketchy.