Store the job env in job_history.
Added a serialized job spec to the job_history table for troubleshooting purposes.
imports and whitespace