Add itertools-based functions to gen.py and provide a little data comparing it to the from-scratch functions