Functional data analysis for density functions by transformation to a Hilbert space