moved global checking to before_filter
added sorting
remove membership management links if team syncs to group
added test to make sure validation does not prevent save