Reworked client design a bit, pulled out reconnection logic and moved to a state machine handler-based approach for each connection phase