Implement a simple text-based protocol.

This is helpful for languages without good WebSocket clients.

Change-Id: I0da9e1d597daa6b58bdddd46b321159dc68ec26c