Refactors the database access code into a separate file
Updates the read me with helpful information.