Extract connection handling from client
Rename handler/ to commands/