Self-balancing binary tree class