Cleaner code for local testing

This also sets the right environment variables to imitate the PBS
environment.
Renamed JobScheduler -> TaskScheduler and get rid of JobScheduler in workflow.py
Why not...
Better logging and reuse of code.