Working on tree sorting algorithm

Currently gets stuck in an infinite loop.  About to tear it apart and
debug.