CSHARP-798. Initial implementation finished and all unit tests pass, including new unit tests for aggregate with a cursor and with $out.