base/primes.jl: generalize primes/mask to BitArray or Array{Bool}.

For smaller numbers of primes, the Sieve of Eratosthenes still seems
to be quite a bit faster. Perhaps we ought to use a polyalgorithm
here, only using the Sieve of Atkin for large N.