writing and reading relation db to and from file

writing and reading relation database to and from file with
serialization. Set up structure of files.