Fix package names and references to Factor classes that were moved back
to algorithm.factored