Full implementation of BST with various functions