Write out database file. Beginnings of reading it back in