Avoid relying on HTMLAnchorElement.protocol; browser support not clear.

Also avoid url.format, since we don't actually need server-side URL
normalization yet and it's not clear what, if any, normalization
url.format does.