Improve loading of malformed XForms

http://manage.dimagi.com/default.asp?142079
http://manage.dimagi.com/default.asp?142193

Note that the XML in case 142079 is so badly malformed that it still does not load, but many of the loading problems have been solved by this PR.
Make XML diffs way easier to read. The commit that added this is also in https://github.com/dimagi/Vellum/pull/262