Reorganizing db.h, db.cc, no functional changes