Implementing Shibashis' checks for enqueueing successors and tree
elements.
Merge branch 'master' into fix-algorithm
Fixed an incredibly silly bug which was causing the queue to get
altered in an unpredictable fashion, simply because of references to
queue instead of !queueref.
Added a structure for the tree we use.
At this point, thanks to the new tree API, we are getting the same results as master. Time for a merge.
Merge branch 'fix-algorithm'