WIP btree rewrite