Fix sending JSON messages

This fixes a major bug (couldn't send JSON at all) and also has a bunch of fixes to integration test setup and diagnostics.

When we couldn't connect to sbt server at all, integration tests still passed. That's why the "can't send any messages at all" bug could exist.



Why " replyTo != 0L" ? What does the zero indicate? Perhaps better with constants that declare what's going on?