SERVER-6754 Create a mock for testing replica set connections

Step1: Create the mock classes for mocking the remote server, connection and replica set

Conflicts:
	src/mongo/SConscript
SERVER-7272 mock_dbclient_connection.cpp compiler warning
SERVER-4706 when a socket between mongos and mongod fails, close all connections immediately

Conflicts:
	src/SConscript.client
	src/mongo/s/shard.h
	src/mongo/s/shardconnection.cpp
SERVER-6754 Create a mock for testing replica set connections

Step2: Created a simple mock for cursor that matches the DBClientBase::query signature, added functionality for mocking queries and added more features.
SERVER-6754 Create a mock for testing replica set connections

Final step: Modify the replica set client to be able to use custom hooks for creating connections.

Conflicts:
	src/mongo/SConscript
SERVER-6754 Buildbot failure fix for shard_conn_test

Explicitly specify port number when instantiating the mock server.
SERVER-7865 Add ability to set query replies based on namespace for MockRemoteDBServer
SERVER-7865 Make copy of resultSet to be owned by mock cursor

Store a copy of the result set returned by a mock query in the
MockDBClientCursor so that the data is not freed when the temporaries
go out of scope.  The copy will be freed when the MockDBClientCursor
is destroyed.
SERVER-7867 repl_monitor_stress.js failing

Converted fragile js test into a more rebust (and faster) C++ test.

Conflicts:
	jstests/slowNightly/repl_monitor_stress.js
Revert "SERVER-7867 repl_monitor_stress.js failing"

This reverts commit c2226286a28c468b8619cca7cfba18737ccc3f6e.
SERVER-7867 repl_monitor_stress.js failing

Put back c2226286a28c468b8619cca7cfba18737ccc3f6e and fixed the test by making sure that the ScopedDbConnection pool is cleared after every test that involves the ReplicaSetMonitor.
SERVER-7572 Remove all code that sends AuthenticationTables

Conflicts:
	src/mongo/client/dbclient.cpp
	src/mongo/client/dbclientinterface.h
	src/mongo/s/chunk.cpp
SERVER-8210 Cannot insert new documents to mock server after doing a query

Changed implementation to use vector instead because BSONArrayBuilder cannot be modified once done() is called on it.
SERVER-7636 Do not use cached connection when read preference changes

Fixed tests that was accessing invalidated BSON internal buffer data.

Conflicts:
	src/mongo/client/dbclient_rs_test.cpp
SERVER-9174 Race condition on read_pref_rs_client.js after reconfig

Replaced js test with cpp unit test that does not rely on reconfig.

Conflicts:
	jstests/sharding/read_pref_rs_client.js
	src/mongo/client/dbclient_rs_test.cpp