Mod handles more simplification

While still trying to keep evaluation fast, Mod will now
removing a gcd from the terms and check for known differences
between arguments. Denesting is also implemented (although
probably more could be done).

Thanks to Patrick Lacasse for this suggestion to check ratios.