Trees and the dynamics of polynomials