cache,tree: move basic name compare functions from read-cache to tree