Create pagePath method which can be mocked
Create pagePath method which can be mocked

Testing this function works correctly is difficult as it is dependent on
the window.location of the test runner. By putting this method in a
fucntion of it's own we can mock it.

alphagov/frontend,alphagov/frontend,alphagov/frontend,alphagov/frontend