Quick spike on refactoring connection keyspace tracking.

This branch is just a quick experiment, and it's not ready for merging as-is, but I wanted to get your response to the basic idea.

This change alone doesn't dramatically improve the code, but critically, it moves detailed knowledge of the current connections out of the client. Doing that makes it much simpler to implement reconnection and automatic connection discovery, which is my ultimate goal.

If you are okay with the approach, I'll update this branch with full comments and tests.