Pretty close to locking down the html output. Time to work on the javascript.
First go at a javascript ui with JSON encoding.