Saving progress, not functioning; work from master or next commit.

Moved generator to project, redesigning the flattening.