Reduce the size of database.cc, and limit the scope of prefix_table, make sure it's accessed via a well-defined internal API.