factory class

adding a factory class and factory_makeAlgorithm() function

when i tested though, i needed to use a factory object to call this
function. :/