Add file db.py and initdb.py