Refactor the function group_get_user_groups(). Bug 1304053

 - Add function comment,
 - Make it compatible to old calls
 - Sort the list out of the queries to reduce the MYSQL queries
 - Set the sort default value when displaying the my group side bar

Change-Id: I50decadcebe8a5cb38706809d70a784e6694c46d
Signed-off-by: Son Nguyen <son.nguyen@catalyst.net.nz>
Merge "Refactor the function group_get_user_groups(). Bug 1304053"