Hilbert class polynomials and traces of singular moduli