The websocket API that I wrote is currently designed to minimize the clientside processing effort. The current test UI just sends single commands to the backend, and posts messages that it receives from the backend (it does not know which backend response corresponds with which request, and does not do any additional processing with it anyway). This works for testing, but might not be what we want for production.
Joel (or anyone else working on the frontend) let me know what changes I should make to the websocket protocol to support your WebUI.