Created database connect and query functionality

Created file db_connect which contains functions for connecting to the
database, and querying the database.