Refactored the PythonTaskPerformer, attempting to undo at least some of the programming sins committed when first hacking it together.