Refactor job status checking logic into its own module.
Add unit tests for some basic behaviors.