fileio.c: improved error handling and comments.
repl.c: improved error handling and comments.
userio.c: improved error handling and comments.