Add getPriority method to Pattern class, Add Junction class

Also added a global variable to switch methods of getting priority.