This simplifies TreeShared and makes code dealing with parents more understandable.
Created attachment 182798 [details]
Comment on attachment 182798 [details]
Looks fine. I still hope that some day we can retire the TreeShared class and find a different way to handle reference counting in the trees, and in a way this takes us one small step closer to that.