Rewrite all the things (for the fifth time)

- Deleting threads deletes them from the index too
- The search template actually gets DBIC results
- Ghosted threads should be ignored
- My headache has set in once more.