Fix #479

Made a slight modification to the groups_members table to have the
constraint where all pairs of group_id and user_id must be unique.
This is to prevent users being put into groups more than once
which may cause problems down the road when we are querying for
group members.

To fix the problem in the ticket I first did a check to see whether
the user is already in the group. If they are no attempts to save in
groups_members will be made but they will be part of group of users
being returned.

An attempt to put the user in the group is then only made if the
username given is valid. If the username does not exist, the user
will be skipped and the system will go on to the next user.