Flesh out connection state machine
Changing state machine to avoid implicit state setting and cohere to spec.