added ability to write a directory back to storage (seems like it works)
fixed some bugs
added write support for a file