Make ellipsis filter more robust

Fix ellipsis so it doesn't incorrectly "close" &lt;br&gt;, &lt;hr&gt;, etc., and also improve speed some.

The current version will turn:

    <p><br />Lorem<br /> ipsum</p>
    <hr />
    <p>break here</p>

into:

    <p><br />Lorem<br /> ipsum</p>
    <hr />
    <p>break&#8230;</p></hr></br></br>

This version uses DOMDocument for more robust handling of the HTML fragment.  If DOMDocument isn't available, it uses another solution, which while it isn't quite as robust is still more accurate than the current version, in addition to being considerably faster.