Address various depreciated APIs in Python

This mostly revolves around old APIs for ElementTree, but includes a few
others as well. Fixes #254. Thanks for the report.