change implementation of autocompleter.js to use trie