bug fixes and major refactoring to improve error logging
Merge branch 'master' of github.com:publicmediaplatform/taskscheduler