Efficient Computation of Chromatic and Flow Polynomials