Add docs for open-file, open-input-file, and open-output-file.

Associated code changes, mostly for clarity.