Change to breadth-first traversal when collapsing a KDTree
The MoveSubtree() function moves trees from lower down in the KDTree up. The existing depth-first traversal recursive algorithm in this function worked okay when descending the tree, but when moving back up the tree, elements in the array would be clobbered before they were moved to their correct destination. This would lead to some views being incorrectly deleted and moved into the wrong location when a level of the KDTree was being collapsed. Change to a breadth-first algorithm so that elements in the tree are always copied from lower to higher positions in the tree. This resolves the incorrect subtree movement.
Showing with 33 additions and 6 deletions