This adds a test to ensure the priority queue works properly both for sorting by fee per KB and priorities. Thanks to @ceejep for the original test code and idea which was subsequently modified and cleaned up a bit to the code here.