Port to message-queue semantics for server-api.

Still needs work with regard to waiting for a connection
before sending queued messages.