BigInteger: refactor randomPrime somewhat