Move some utility code off into a separate class

This is the first stage of starting to add more complex priority sorting, moved
the existing getPriority function off into a utilities class in which I
intend to add additional methods