Replace struct dbt with typesafe std::map wrappers

Also fix broken save/accreg.txt reading.