Extract JSON serializer
Serialize window handles using JsonSerializer
Serialize console messsages using JsonSerializer
Escape control characters in JSON strings
JsonSerializer returns QByteArray

JSON supports UTF-16, however the serializer is 8-bit clean.  Instead of
returning a QString only to turn it back into a QByteArray, return a
QByteArray on serialization.
Infinity returns null when serialized

From RFC4627:

  Numeric values that cannot be represented as sequences of digits (such
  as Infinity and NaN) are not permitted.

NaN is invalid, so we already return null.
Support multi-line confirmation messages
Support multi-line alert messages
Support multi-line prompt messages