Predicative Recursion, Ramified Diagonalization and the Elementary Functions