refactor shared code into test_utils file

moving some of the code used to test the jobs model into a shared lib so it can be reused by the log_viewer (and other) tests.