[DEV-368] Refactor reconnection logic
Merge branch 'reconnect-refactor'

Conflicts:
	test/test.cfg