fixed var statements in lib/trie.js to avoid leaking globals