Builds trees of Leaf nodes from flat ones.
The tree under root of these flat nodes, each made a leaf by toLeaf.