Binary search tree implementation.