Fix bug: remove database names from save-file names.

The database name can contain a variety of characters which may not be
acceptable as a file name on a filesystem. The fix is to remove the
database name from save-file names, and instead store the database name
in the save-file.

Bug reported by Josh Kupershmidt [1].

Other minor changes are also included. Notable one being that the
fileRead/Write() functions now take one less parameter, which always
had a value of 1.

[1]: http://www.postgresql.org/message-id/CAK3UJRGKOzx_pO+QESNKncHRVZeaNfeueJDM+L41aKcKNogPqw@mail.gmail.com