Implemented job wait for SLURM, some cleanup