Added prime factor function and tests.