Corrected factorization method

Updated the factorization method to *actually* operate in O(sqrt(N))
time, assuming it has a list of primes.  Also updated the comment
describing the time complexity of the Sieve of Eratosthenes.  (Actually
performs in O(N*lg(lg(N))), not only O(N^2).  BIG difference.)