Change client query using `get` instead of `filter_by`.
manual revert of 26302a50. That "workaround" is not required.

There was a check to work around collation issues with Oracle.
The reason to add this behavior, were duplicated records with different case.
The `clients` table is only filled by opengever. We need to maintain consistency
of case ourselves to make quering easy. Having two records with the same primary_key
in different case is going to break the application anyway.

/cc @lukasgraf
use `get` when only filtering by primary key.
Reworked is_group_member, so that it only use one query.
Refactor get_user_sort_dict.