Make a package
Move HTML stuff and Python 2.x/3.x compat stuff out of __init__.py
Use methods rather than closures for XML parsing, avoid the nonlocal hack
Shuffle stuff around.