Fixed group peer chosing algorithm.

Groups should be much more stable.
Reduced the risk of two people being given the same peer id in groups.
Send friend request with connection if for some reason (groupchats) we
are already connected to the friend but they have not added us yet.