Allow collection.group to use a function for group keys

In the group method, mongo allows the "group by" keys to be a function. This change allows a function specification to be passed in the key parameter enabling this feature.