Finished Prime Factorization in JS.