Fix mapqueryhash()
Update may_edit() so it can deal with newly inserted nodes as well

In these cases the tree index has not been rebuilt yet, so we must use the parent's position in the tree.