Fix all the KeyErrors caused by reprs of dicts being logged as strings, ...

...and generally make formatting safer.

https://autoscale.airbrake.io/groups/60982359
https://autoscale.airbrake.io/groups/60887965
https://autoscale.airbrake.io/groups/60887967
https://autoscale.airbrake.io/groups/60799899
https://autoscale.airbrake.io/groups/60722210
https://autoscale.airbrake.io/groups/60722209
https://autoscale.airbrake.io/groups/60721378
https://autoscale.airbrake.io/groups/60232366
https://autoscale.airbrake.io/groups/60236162
https://autoscale.airbrake.io/groups/60232365
https://autoscale.airbrake.io/groups/59617630