Move logic from BSONElement::canonicalType to canonicalBSONType free function

Prep for SERVER-6125 - Agg $sort on heterogeneous types
SERVER-6125 - Add tests for heterogeneous $sort operations in aggregation

Signed-off-by: Ian Whalen <ian.whalen@gmail.com>
SERVER-6125 - moved jstest to correct location

Signed-off-by: Ian Whalen <ian.whalen@gmail.com>
Fix test to not use collection.aggregate since it needs its own error handling

Follow up to SERVER-6195
SERVER-6802 allow trivial bulk insert for SCCs
SERVER-6802 preserve correct continue-on-error semantics for mongos bulk inserts

Also divides batches into sizes manageable by the WBL

Conflicts:
	src/mongo/s/strategy_shard.cpp
SERVER-6802 errorcode
SERVER-6802 fix call to insert()
SERVER-8292 SERVER-7843 SERVER-7087 Make tojsonObject handle Error objects

Use the toString() method of Error (and derived) objects to convert them
to strings in tojson() and related functions.  These objects have no
enumerable properties, and so display as "{ }" if not handled specially.
SERVER-7118 Fix include order and whitespace in module.h/cpp
SERVER-7565 Fix typos and style
SERVER-7565 Make line endings Unix-style on Windows
SERVER-7718: more test cleanup related to Timestamp
SERVER-7849: fix Random.genExp when random returns 0
SERVER-7849: typo
SERVER-7872: check retval of backtrace_symbols