Improved work with groups of contacts (#6).
Improved naming, added comments and others minor improvements (#6).