MongoDB: Aggregation workaround by helper collection
Once you go beyond the limitations you mention (until $out is supported at least), then your best option is Map Reduce.  If you are going to run multiple Map Reduce jobs, I would recommend version 2.4 at least (uses V8 engine, muti-threaded).  For an example of how to do a unique count with Map Reduce, take a look here:

http://cookbook.mongodb.org/patterns/unique_items_map_reduce/