Enable threaded compilation
Fix reindex
WIP
Refactoring