A simple implementation of a trie using Javascript