groups: port missing functionality

* Adds implementation of user group manage function.

* Adds filter on list of group that user can join.
  (closes #1788)

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
general: WTForms 2 compatibility fixes

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>