Issue #28 - Mke a db module and move code for DB into it