Use difflib for diffing

I think this is what we need to fix #1582.