Added missing primes implementation

Added a library for dealing with prime numbers, this was missing from
the previous commit