Add toJSON method to UnicodeTrie