groups: REST API and API addition

* Adds API and REST API for the groups.

* Implements a policy for "pending" and "member" state of user
  in a group.

* Removes current_user dependency in accounts model.

* Refactors the views to use api instead access directly to
  the models.

Signed-off-by: Konstantinos Kostis <konstantinos.kostis@cern.ch>