Correct a few things in the file handling; make it read/write by default, but add a read-only option