trees: cleanup binary tree measure height and balanced