Refactor global_mapping_find and add the correct redirect to its end

- Fix the known bug in the previous commit whereby ?path was encoded.
  The URL to the mappings editor now works in the redirect.
- Use URI.parse instead of regexes to get hostname & path from the URL.
- Remove long-winded comments and debugger lines.
- Adhere more strictly to the style guide.