WatcherThread: move WATCH_STOP handler
Indexer: add factory function
Term collection: update term collection
App: add some log messages
IndexData: rename decreaseCount to decreaseDocumentCount
App: commit and close database for IndexData too