Correct some uses of now-undefined CSS classes.
DRY a little more in htmlify().
Simplify a little JS.
merged UI into bug949608