Fix bug in euler.primes function prime_sieve

The function did not correctly run up to the bound given, it instead ran
up to the number - 1.
Fix euler.primes function prime_factors

This function terminated early for small numbers, and for large numbers
it would overflow. We now use a generator to prevent overflow, and test
until we are sure the number is either prime or we have all the prime
factors.