Switch to arrays instead of objects

(hopefully this will make the trie smaller)