Monomial refactoring partly complete, not has as far as I can tell without proper testing correct gcd, lcm and divides algos