text: Title: Do .dump_tree() in JSON format as well
  Body: This feature request is posted on StackOverflow: https://stackoverflow.com/q/66239653/3648361
  It sounds like a good idea. The suggested returned value is not exactly JSON string, but a serializable structure of dict and list that can be saved to JSON file by one liner.