Sorting / limiting the Mygroups sideblock (Bug #1304053)

Using the settings that the user has in their account settings.

Also fixing up group_get_user_groups() so that it can return count
before any limiting is applied.

Change-Id: I66318b9d739530b121e5a14928326ef4bdf2f880
Signed-off-by: Robert Lyon <robertl@catalyst.net.nz>
Merge "Sorting / limiting the Mygroups sideblock (Bug #1304053)"