Use async DB for autocomplete

This was probably hanging previously because I was passing a JS function for
onProgress, which apparently isn't allowed.