Add tests to check tail recursion eliminiation.