First attempt to make building Tree tailrecursive.