initialising db twice just returns a new db instance
adding file writes - tests currently broken
seperated tests.  db now writes index and data and the index knows about the data