Moving all webclient tree projections to helper functions out of views.py
Tweaks to pass flake8 for webclient.tree
Pass back maps for Permissions in HQL projections (Fix #9107)

@cneves ran into an issue where he needed the accessors
on Permissions (canAnnotate, etc.) from a projection.
Rather than returning permissions.perm1, a single long
value that gives none of the canX context, you can now
return the permissions object itself which is transformed
into a map of the form:
```
{
    'canAnnotate': True,
    'canLink': True,
    'canEdit': True,
    `canDelete': True,
    'perm': 'rw----',
}
```
webclient.tree parsing permissions using the new permissions projection support (see #9701)