Refactor URL so that Origin is part of the path

Cosmetic refactoring to take origin from a query string parameter to part of the context path. Tested with @glasnt by pointing at production data and confirming results compared to live machiavelli. 

AfC