Fix for `addChild()` happening out of order

This commit relies on my previous work in Pull Request #1 (branch drfloob:feature/unstable_sort).

`addChild()` was adding children correctly to the model, but adding out of order to the tree itself. The first child would always be pushed to the end of the array.

Test added in commit 9da1ede. Fix added in 51b036d.