Fix some serious bugs in Rational and gcd.

This adds a bunch more ScalaCheck tests that caught some problems.
There was an issue involving gcd and Long.MaxValue, and a few other
sign-handling problems in Rational. These would not produce incorrect
results per se, but would violate Rational's assumption (only the
numerator should be negative) which messes up equality.
re-release 0.4.0