Many changes to support ExpandHostedAddrToURLs.