Encapsulate internals of union_find class.