Refactored BST insert exercise.