Fixes NPE.
Fixes NPE while running tests.
Adds thread dispatching on provider added or became online to avoid blocking other listeners as this dispatch can be slow.
Creates new Iterator when returning the root subgroups as we are iterating it simultaneously
 on different locations and we can see from time to time ConcurrentModificationException.
Fixes creating unresolved contacts and groups, search for already existing contacts and groups before creating unresolved one.