This obsoletes id:20170414025004.5334-1-david@tethera.net. Let me repeat the warning from that version: ,---- | WARNING: reindexing is an intrusive operation. I don't think this will | corrupt your database, but previous versions thrashed threading pretty | well. notmuch-dump is your friend. `---- Compared to the previous version, this one cleans up the code to print total file counts (splitting into multiple commits), and updates doc and tests. There is a lot of code movement here, mainly splitting up database.cc d