new conversion code, smell fix in db.py __del__, better /cmd support