SERVER-15539: Properly save/restore state when yielding in M/R

This fixes a regression introduced in commit 29a700ad.
SERVER-16469 findAndModify runImpl(): improve error reporting

Previously, findAndModify ignored errors encountered in calls to
PlanExecutor::getNext() when searching for the document to modify.
Now, errors are bubbled up to the user.
SERVER-16469 findAndModify runImpl(): set limit of -1 on query

This allows findAndModify operations that include a sort to take
advantage of the top-K sort logic in the query engine.  This reduces
the memory footprint of the operation from O(N) to O(1), where N is
the number of documents matching the query predicate.
SERVER-16482 Do not look further in the conflict queue if X lock was just granted

This is a small optimization, which would help with the LM cost in the
presence of X-lock conflicts, such as the MMAP V1 collection lock.
SERVER-16429 Add ScopedTransaction to AutoGetCollectionForRead and Map-reduce
SERVER-16394 Fix JSThreadConfig leak
SERVER-16490 do not reset connection outside of bgsync thread
SERVER-16485 properly clear progress meter on failed index builds
TOOLS-450 some dumprestore js tests query system.indexes or system.namespaces directly

Closes #875

Signed-off-by: Benety Goh <benety@mongodb.com>
SERVER-16429 Add ScopedTransactions to places which were missing it
SERVER-16429 Get rid of assertWriteLocked which was doing incomplete check
SERVER-15743 Fixed size_t overflow in SaslClientSession::setParameter

Closes #872

Signed-off-by: Benety Goh <benety@mongodb.com>
SERVER-16458 Add lock manager perf tests to dbtests perf

Closes #874

Signed-off-by: Benety Goh <benety@mongodb.com>
Revert "SERVER-16429 Get rid of assertWriteLocked which was doing incomplete check"

This reverts commit 77f3100bc8753055224abb0c6439fc506eeb02de.
SERVER-16500 Change the meaning of getReplicationMode() to be constant after start up.

Previously, ReplicationCoordinator::getReplicationMode() returned modeNone if
the settings object indicated the node was part of a replica set, but no valid
replica set configuration had yet been discovered.  With this change, the
settings object is the sole determinant of the return value of
getReplicationMode().  Callers that wish to know if a replica set member is
initialized should instead check ReplicationCoordinator::getMemberState().  If
the value is RS_STARTUP, then the node is not initialized with a replica set
config.

This has the side-effect of removing the mutex in ReplCoordinatorImpl from the
code path for this method.
TOOLS-450 Revert restorewithauth.js

This partially reverts commit bf834456c3e5a02fbe6fed340563a3c5fa548e4c
SERVER-16455 do not start election while in hbreconfig state
TOOLS-494: fix restorewithauth.js and TOOLS-497: fix dumprestore_auth.js
SERVER-16481 Replace internalShardingMaxSplitPointsPerOperation
SERVER-16503 take correct lock for index builds during replication apply ops