Moved task factory into separate module. Closes #92.