Make doingMerge a property of DocumentSourceGroup rather than ExpressionContext

Prep for sharded $out (SERVER-10097). Will need to be able to send a
merging $group to a shard.
SERVER-10097 sharded $out

Note that all sharded aggregation tests now go through the
"merge-on-mongod" codepath now rather than the "merge-in-mongos"
codepath.
Support cursors returned from sharded aggregation

Follow-up to SERVER-5932
Make DocumentSource handling more generic
Error out if $out collection is sharded
Add a multi-version (2.4 and 2.6)  test for sharded aggregation.