Cleanup write processing
Convert debugging to use debugs, add json printing
Display all fields in json
More cleanup