more fixes to Chief script around generate_files

Move generate_files call to run before checkin_changes
Make "./generate.py" call work by ctx.lcd() before running