DB functions now in separate file. Created db_delete function. Improved db_* functions: now handle null values better