Updated version of html_entities()

Had to rewrite most of this function, because the original wouldn't properly quote:
    This is a "test"
The parent version outputs:
    This is a &amp;quot;test&amp;quot;
instead of:
    This is a &quot;test&quot;

This version does remove a bit of functionality, but I think it reads better, and most importantly it works for me now :) Hopefully it helps someone else too.