Let disjoint sets be built from element generators

The code no longer expects that its source of elements can be recycled.