Refactored client/server interaction into Connection subclasses.