aggregate wip - test fails with null reply.  Not sure why

I was just trying to implement aggregate in the same way as distinct but have got a little stuck.  Not sure why the reply is always null - I'm not getting any errors.

I wrote a test first, and an example you can use at the mongo shell.

If you can spare any of your time to see where I've gone wrong I'd appreciate it.  Might be really simple.

In the meantime I'll keep working at it and will close this request and open another one if I get it working.