Write function (remove x T) that removes key x from binary search tree T, and returns the resulting modified tree.