Automatic shell saving/loading

Saving is now handled at the end of each shell command, and files are
reloaded at each command in case of external editing.