Pulled prime methods to own module

The Prime Factorization and Next Prime projects were both using
the primes generator and the is_prime method. So I pulled
them up to a module named 'prime' under the package 'common'.