cleanup & make bstree,rbtree template classes