Functionals of Dirichlet processes, the Markov Krein Identity and Beta-Gamma processes