Add more thorough tests, and add to_json test
Implement `to_json` in C++ code.
Implement `to_json` in drivers that care.
Move this and make it `mt`.

Yeah, okay, so I still haven’t figured out what the difference is, but
still…
Move this one too
Derp, that's a method query
Fix name term
Merge branch 'gchpaco_2513' into next

This fixes #2513.