John Resig's trie implementation, prettified and packaged for npm.