Backport format_html for Django 1.4 compatibility

It doesn't exist in Django 1.4. Easiest fix is to just backport it.