Refactored num_divisors to use slow_primes factorization.
Cleaned up dead code.