Use JSON to send/receive group data.
Squashed commits from PR #4364 for master.
Break long lines into smaller ones.
Merge pull request #4447 from owncloud/fix_4351_master

Use JSON to send/receive group data.