memoize group.get_user_ids

among other things, this will prevent hitting the db to get all users
in the group once per document during a group-filtered export
make it a separate function just to be safe
Merge pull request #518 from dimagi/cz

memoize group.get_user_ids