changed distinct degree factorization so as to use precomputed inverse versions, less gcd's,
and less modular compositions
added benchmark test