Cleaned up some diagnostic output.
Added a test to make sure directory is writable.
Added a read test for directories.