SERVER-13635 fix registerStorageEngine to take ownership of and free factory
SERVER-8514 return error on invalid count query on empty collection

Closes #783

Signed-off-by: Benety Goh <benety@mongodb.com>
SERVER-14062 Remove extra creations of OperationContextImpl in the sharding dbtests
Merge remote-tracking branch 'upstream/master'