Rewrote #prime? to be much faster.