Use pytidylib to clean up content HTML fragments

Fall back to previous behavior if tidylib is unavailable.