Massive changes to db.js to simplify in order to implement put. Put implemented for visits need to copy for others