Refactor to reduce use of globals
Move TERM_NAME_RE to pyxterm, where it's used
Clean up HTML a bit