Maximal functions and Hilbert transforms associated to polynomials