Adding generator.py and the test.