Trie implementation for node.js