Improved client connection architecture.

Improved client connection architecture.
Added ServerConnectionManager class to manage the server connection.