Add support for domain registration

This isn't the cleanest series of patches. There's some random things like adding http proxy support and fixing a Python 2.7 issue but pretty small changes.