Add AbstractBinaryTree base class to encapsulate common functions.