SERVER-4706 when a socket between mongos and mongod fails, close all connections immediately

Conflicts:
	src/SConscript.client
	src/mongo/dbtests/mock/mock_dbclient_connection.cpp
	src/mongo/dbtests/mock/mock_dbclient_connection.h
	src/mongo/dbtests/mock/mock_remote_db_server.cpp
	src/mongo/dbtests/mock/mock_remote_db_server.h
	src/mongo/s/shard.h
	src/mongo/s/shardconnection.cpp
	src/mongo/util/net/sock.cpp
SERVER-7602 add action_type files to client build
SERVER-6514 Re-add support for building the C++ driver shared library

Primarily a backport of da8c0fa929eeb03dbe3fb0533874de31da0bc8c8, with
the following SERVER-6514 fixups patches from master rolled in as well:

680f0bf57260bf020cfaeb35598861c6b89524cb
48f8431210aba4de7d108852bc1d87267237d358

Conflicts:
	src/SConscript.client
	src/mongo/SConscript
SERVER-8150 Always stage sasl files into client archive

Conflicts:
	src/SConscript.client
SERVER-8501 Rename MONGO-CR to MONGODB-CR
fix appendNumber casting #527
SERVER-7202 add support for ssl smoke testing

Conflicts:
	buildscripts/smoke.py
Add bson_extract.cpp to client library
SERVER-6514 Only run global initializers from httpClientTest for in-tree SSL builds
(cherry picked from commit 3ba5acdb56f4268f56debd18db0fd6cf962572b4)
SERVER-4795 mongostat sleep for correct amount of time when multiple hosts specified

Conflicts:
	src/mongo/tools/stat.cpp
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.