fix index in commented ref test
cleanup existing tree entry code
add tree tests except write are passing