Tweaks

I can submit any of these as a separate pull request if you prefer.

* Minor cleanup
* Add support for IDN (in punycoded form)
* Usability improvement: automatically update URLs as the user enters domain names