Rewrote radix tree, much cleaner now.