Misc. fixes around attachment indexing, added some reporting and
refactored index worker.