Fix display of priority field in queue export

Also removes the fetching of priorities separately and addresses sorting of priorities by the ID field rather than the urgency field.