groups: port missing functionality

* Implement user group manage function

* Add filter on list of group that user can join.

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
what about
```python
primaryjoin=db.and_(Usergroup.id==UserUsergroup.id_usergroup,
                    UserUsergroup.user_status==UserUsergroup.USER_STATUS['ADMIN'])
```