Fixed the problem of scheduling not working with the proper id. Pattern substitution was wrong. Also cleaned up sbatch.mk a bit and added a test suite.