Replaced PARI primality testing with FLINT primality testing