Add BTree::add_index_entry() and BTree::erase_index_entry(), and use them to fix a couple of bugs.