Clear up variables.
Add reason when transitioning job to failed state.
Add basic logging.
Interm assignment for queue-to-group mapping.
Read stderr incrementall as well.
More docstrings.
CLean up accumulation of results.