Add a more type class instances for Polynomial.

This adds type class instances for Semiring, Rig, Rng, Module, and
VectorSpace for Polynomial.
Minor fixes to Polynomial GCD.

The GCD for polynomials had weird behaviour. While technically correct,
saying that the GCD of (x^2 + 2x + 1) and (x - 1) is 4 isn't what I
expected. This was first fixed by returning the GCD as a monic, but then
we get 1 as the GCD 2 * (x^2 + 2x + 1) and 2. So now we first factor out
the GCD of the 2 polynomials, so the leading terms are coprime. Then we
find the GCD as a monic, then multiply by the factor we first pulled
out.