Wrote lattice generator and added common files.
Added command line options and added outfile.