Fix bugs, rename pbs script, move reduced script control to ruby instead of relying on bash script