Refactor group functions a bit.

* No need to call lookupIterator for _.identity.
* Hoist function creation to load time.

Thanks to @jdalton for the discussion.  :)