Add HTML fragment support

I needed a way to retrieve html fragments with inlined styles. I'm using DTRichTextEditor and need this functionality there. Please let me know if there's something I should correct in the commit in terms of style, etc.