Factor out PrioNodeQueue to a template