Refactor into a service and separate task classes.  Still needs to be cleaned up, but seems to be working.
Cleaned up comments/logging around the new service code.