Changed lattice.py so buildLammps and buildXyz properly close files upon completion
Moved openfile until after assertions so file is not opened if build fails