Moved working portions of dbtest.c into a database.c/h combination which will ultimately be used to handle all database queries.