That was a quite off-the-cuff remark, so I took the patch and culled out loaded-tree bookkeeping. A lot of other changes fell off from that, so it took me quite some time to get it working again, but here it is. This is a *lot* smaller patch, although that's partly explained by the fact that I left out some features: prefetching and the neighbor relocation code is gone.
I'm pretty exhausted by this, so I just wanted to send this out without further analysis. Let me know if you have questions on the approach taken. I'm also not sure how this performs compared to your latest patch, I haven't done any performance testing. Feel free to use this as is, or as a source of inspiration :-).
I also was going to try to evade keeping loaded-tree hash. This might help me a lot. Thanks.