Changed the PriorityQueue to store the comparator function in a metatable to avoid serializing the comparator function to the global table.
This means that the PriorityQueue has to be restored on load.
Plus side is we can use comparators that are closures.