Separating database items into own module. Adding tests for database.