organization_list_for_user() fixes

1. Fix a bug in `organization_list_for_user()` that it was returning organizations that the user was previously a member of, instead of just the current ones (what this means is that in some parts of the UI, e.g. on the organization's page or on the site front page, at least the titles of private datasets are shown to users who _used_ to be part of the organization)

2. Add a docstring to `organization_list_for_user()` that explains what it does

3. Add tests for `organization_list_for_user()` (it currently doesn't have any, either new or legacy)

Fixes #1917