Use the group loop instead of manually creating a groups object.

Fixes problems with the "bp_group_manage_members_admin_item" hook as that
hook relies on the $groups_template global.
Trim whitespace.