Added a bunch of logging calls and made significant improvements to background indexer