Make code to list groups for a user reuasble from SSH commands

The motivation for this refactoring is to be able to implement in a
later change a new option for the 'ls-groups' command that allows to
list the groups for a specific user.

Change-Id: Ia5b2e330cb5a4f77ecd7de25d7d129417bf8376e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
4 files changed