HTML-escape canonicalized URLs, assorted other test fixes.