Adding "factor" helper.
Adding helpers tests.
Optimizing Problem12.