Refactor way checks to globals

All /way/id# checks involving xpath expressions are using global methods in a different file