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.
Test Plan
Doesn't break Jenkins (once the settings are correct)
Migrated from D1099 (view on Phabricator)