devide connections on levels, store 2nd connection parent and snapshot

Signed-off-by: Pavel Astraukh <paladin111333@yandex.ru>
cap multistage

Signed-off-by: Pavel Astraukh <paladin111333@yandex.ru>
bug fixes

Signed-off-by: Pavel Astraukh <paladin111333@yandex.ru>