Add docstring for quotefordtd()
Remove call to singlequotestr() in quotefordtd()
Remove unnecessary if clause in quotefordtd()
Remove singlequotestr() since it is not used anymore

Also remove escapesinglequotes() which is only used in singlequotestr()
Remove calls to quotestr()
Remove quotestr() since it is not necessary anymore

Also remove escapequotes() and quotestr() tests.
Split line to make code more readable
Fix % character escaping

Added more escapes for % and changed the preferred escape to &#037;
Fix in test_quotedtd() when testing % character escaping
Decorating test_invalid_quoting() with xfail