Trie in Javascript: the Data Structure behind Autocomplete