Reveal the intent of checking the return_path
Tighten return_path check
Add tests for preventing malicious redirects
Refactor off-site checks into shared code

Also add more tests.
Add a bookmarklet for editing a mapping
Fix error in mapping saved modal on non-site pages

It is possible to have saved_mapping_ids in your session, but to be viewing a
page which doesn't relate to a site, so @site isn't set. Before now, this would
mean seeing a 5xx error page.

I was able to reproduce this by saving mappings in one tab and quickly
refreshing the homepage in another. There are lots of other ways to trigger the
problem.
Add another spam pattern
MappingsController#find_global should keep query

If the querystring is relevant, this meant that it was lost when it should have
been kept.
Merge pull request #228 from alphagov/fix_handling_of_querystring_in_find_global

MappingsController#find_global should keep querystring intact
Fix inability to handle UTF-8 characters in query

optic14n uses URI.encode_www_form_component which handles UTF-8, unlike
CGI.escape.

There are a few URLs that have this characteristic which we got from the
Environment Agency logs.
Merge pull request #229 from alphagov/fix_inability_to_process_utf8_querystrings

Fix inability to handle UTF-8 characters in query
Merge pull request #226 from alphagov/fix_error_displaying_modal_on_non_site_page

Fix error in mapping saved modal on non-site pages
Treat nil as not being an on-site path

This simplifies the code a bit.
Merge pull request #217 from alphagov/tweak_return_path_check

Tweak return path check
Merge pull request #224 from alphagov/add_edit_mapping_bookmarklet

Add a bookmarklet for editing a mapping
Retrieve organisation_slugs from site YAML
One site can be owned by multiple organisations on import

- We only create this relationship for the extra organisation slugs,
  not the ones that were there originally, i.e. whitehall_slug.
- Fix some whitespace between {} in a block.
Ensure that site-org relationships always reflect organisation slugs

- When an organisation decides that it doesn't want a
  sub-organisation editing mappings anymore, we can remove the
  sub-organisation's slug from organisation_slugs in the YAML and the
  import will remove the relationship. That way, we don't have to
  manually delete the rows from the database.
Improve test coverage

- When multiple organisations are added, then one is deleted from a
  site, the relationship for the other still exists.