The most obvious bug here was that the "modify" variable was
uninitialized, thus the search for crossed parents resulted always
true for the very first parent. Therefore, every time a node was
moved, the tree was rebalanced below the node.
Fixing the uninitialzed variable bug revealed other problems in the
crossed subnodes search, which was broken too. This patch modifies the
crossed subnode search a slight. It will now return true if it finds
any subnode that the movement would cross, stopping the search
instantly as soon as such node is found.
If either crossed parent or subnode is found, the node is removed and
added back to the tree in order to ensure it will be put in the
correct place.
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>