factor: don't generate as many primes when doing trial division.
primes: implement and test prime stuff for BigInts [closes #3033]

It is not recommended to use this code to factor large integers. The
primality testing for BigInts calls GMP, so should be pretty good.
test/Makefile: allow mpfr to be tested in isolation.