add nontrivial parameter to getFactors in factor module.

getFactors now have the ability to return only nontrivial factors.
minor fix for factor module.
fixed a bug for getFactors in factor module.

fixed a bug in getFactors when primeFactor is enabled.
the bug causes getFactors not properly return all prime factors.
add test cases in the test for getFactors.