Revised to use HtmlTextWriter instead of just output, and to exit if there is no context item.
Merge pull request #7 from ptiemann/CanonicalURL

Revised to use HtmlTextWriter instead of just output, and to exit if the...