Python 3 compatibility

Tested against:
2.4.3 (for itertools.product compatibility), 2.6.6, and 3.3.2

Python3 adds some additional functionality in os (getgrouplist) which may be useful in environments where people want to pull NSS group lists.