Start ordering subnodes

Previously, subnodes stayed in the same order they're specified in
the input, which resulted in more crossings at the subnode level
than was necessary for a given node ordering. This addition orders
subnodes by taking the existing ordering for the last layer, and
applying the ordering found there to successive previous layers.
Then the same thing is done again from front to back. Doing it in
this way is desirable because it is more visually pleasing to have
subnodes cross as they leave a node, rather than as they enter
it.