Add (untested) pregen command, todos and fixmes