Added file creation, file writing, and file mode changing.

Added file creation, file writing, and file mode changing.
Other minor fixes and additions.