domain support

I don't know if you want to support domains, but it's a relatively small patch. The tests are a little wonky because we need to escape the domain before proceeding with the tests.