add support for ptr=_id to return document id

This is useful when combined with the identity reducer to return
the list of all document id's that were a part of this group.

For example:

    /database/_query?ptr=/metric/samplea&reducer=avg&ptr=_id&reducer=identity&group=1000000000

This query returns the average value of /metric/samplea and the list of all
document ids in this group.