add db.py, rewrite README.md