Refactor group functions a bit.

* No need to call lookupIterator for _.identity.
* Hoist function creation to load time.
Merge pull request #1233 from braddunbar/group-refactor

Refactor group functions a bit.