Move trial factoring of n-1/n+1 out into is_prime and speed up trial factoring.