First rough, but working, implementation of the trie-based cache setter/getter functions. Memory leak present.