Vastly improved primefactor.js efficiency, corrected case where numberToFactor is prime