Re-implemented functionalities in primes.c.
Re-implemented functionalities in primes.c.

The new functions are more correct than the previous ones.
The new implementation is not GPL-2 licensed.
The new implementation is deterministic.
The new implementation is generally faster.

giuliopaci/acopost,giuliopaci/acopost,giuliopaci/acopost,giuliopaci/acopost