Purge dout() from json.cpp. Throw exceptions in stead.
Warn on unrecognised JSON object type.
Purge some more dout() and retore some to debugmsg().
Restore old dout() initial-newline behaviour.