Introduce InputLine to main loop
Use LineInput everywhere
Rename process_line to process_commands
Show file name on error
Set default caption format to "Figure XX: "