Allow HTML in custom error messages

I'd like to embed a link in an error message.  
In this change, if the error object in the element's data derives from HTMLElement, it's appended to the <li>.  Otherwise, it's set as the <li>'s text.