Add -json output mode for shell

Implement #523, --json for the shell.
Thoughts on this being a SQLite shell mode like MODE_Pretty?