Using zeta functions to factor polynomials over finite fields