More refactoring from old name
Configure database

Enable foreign key constraints and write ahead logging
Use non-exclusive db transactions