Refactored indexing/searching for #16, fixed race on workspace changes (#3).