Code generator

generator.js is the interesting file.