[beeswax] Fix HTML escaping of result table

Check for XSS and NULL display.
Move logic to backend to do it only once and more efficiently.