remove Python 2 cruft
add support for <foo />
rename pretty_text()