Moved the client networking into its own class.

Signed-off-by: Raphael Catolino <raphael.catolino@gmail.com>