Various fixes to sort out client/tornado server comms.