Refactored db.py. Added config.ini