refactor state autocomplete function to only match beginnings of strings. closes #547