Enhancing tests.

Abstract all the similar connection tests for clients.
Add RPC communication tests for gevent version.