Fix autodump timer in the database.
Improve atomic dumping of database files..
Remove some more useless comments.
Make a common helper fn. for thread_(list|tree).