Old-style file read and write

Previously, the code used IO#read and IO#write for reading from and
writing to files.  These methods did not exist in Ruby 1.8.7 and so
the code was not compatible.  This change uses the File#open {} method
for reading and writing and is now 1.8.7 compatible.
Merge branch '187-compatible'