[WIP] Using aliases to allow reindexing with atomic alias switching

Rebased #264 on current master.