Improve job queue fairness
This MR comes with two commits.
The first one introduces another test case which tests the fairness: when faced with two jobs with equal priorities but different type, we should be taking the one that was registered first. At that commit, this new test fails.
The second commit essentially fixes the test and makes the job picking part more fair by looking at registration time as explained above instead of just pulling from whatever queue comes first in the list.