[#626] Tweaks dashboard to have 3 new subpages

A my datasets, my orgs and my groups pages. Each one showing ownership of the
relevant items within it.
[#506] Tidys up views to have better breadcrumbs for editin user
[#953] Add API tests for private dataset activities

Add tests that no activities are emitted when creating, updating or
deleting private datasets via the API.

These could be more detailed, e.g. test adding, deleting and updating
groups as well, or moving the dataset between groups or between orgs, or
testing what happens when a private dataset is made public or
vice-versa.
[#953] Move new dataset visibility to first stage

Move the visibility option (public or private) when creating a dataset
to the first stage of the dataset creation form. This fixes the issue
(#953) that an activity is emitted when creating private datasets. Since
the dataset is actually created when the first form is submitted, and
the public/private setting is not chosen until the third form, the
dataset is public at the moment when it's created and an activity is
emitted.

It seems to make a lot more sense fo the visibility option to be on the
first form next to the organization option anyway.

Fixes #953.
[#953] Allow anyone to read datasets with no org

If a dataset has no owner organization, authorize anyone to read that
dataset (regardless of whether it's public or private).
[#953] Fix display or Organization and Visibility dropdowns

Fix the logic for displaying the Organization and Visibility dropdowns
when creating or updating a dataset.

We really need frontend tests for this.

I tested these cases manually:

User is not logged in and anon_create_dataset = True: neither
Organization nor Visibility shows, either when creating or when updating
a dataset.

User is logged in, but is not a member of any organization: neither
Organization nor Visibility shows, either when creating or when updating
a dataset. Tested both when the site has no organizations and when the
site does have orgs but user is not a member of any.

User is logged in, and is a member of an organization: Both Organization
and Visibility show when creating a dataset.

When creating a private dataset, no activities appear in the activity
stream.

User is logged in, and is a member of an organization, but dataset is
not a member of any org: neither Organization nor Visibility shows when
updating a dataset.

User is logged in, and is a member of an organization, and dataset is a
member of any org: Visibility shows but Organization does not show when
updating a dataset.

User is sysadmin, site has no orgs: neither Organization nor Visibility
shows when creating or updating a dataset.

User is sysadmin, site does have orgs: both Organization and Visibility
show when creating or updating a dataset.
[#953] Don't show inactive datasets

Don't allow non-sysadmins to read inactive datasets.

This fixes a test that was failing.
[#953] Don't allow private datasets with no organization

Add a validator to prevent private datasets with no organization from
being created by package_create or package_update.
[#953] Adds JS module for disabling visibility field on dataset creation

Essentially we get the current value of the visibility dropdown and then if no
org is selected then we disable the visibilty dropdown and set it to be public.
[#626] Use helper functions to get orgs/groups for dashboard plus cleanups
[#861] Change the logic for sorting dataset search

Default to metadata_modified desc if no query and relevance if there is
a query.
[#861] Remove 'metadata_modified' from if

Also, modify the default sort order if there is a search query to be
"score desc, metadata_modified"
[#861] Use the .get() function to look for 'q'
[#1025] User log in/out fixes including i18n and non standard root url
[#1025] Fix failing tests due to extra redirect etc (stupid tests)
Merge master
[#626] Fix for dashboard templates to go full width
Merge branch 'master' into 1025-user-login-fixes
[#1039] make sure came_from url is sane (local)
[#1039] Minor code cleanup - unused imports