Move job_exists to an external library
This avoids very red script security warnings and also allows to use the jobExists function in other jobs.