Merge pull request #5 from ptiemann/CanonicalURL

Canonical url
Merged in some non-Sitecore 7 changes from the sitecore-v7 branch so that Paul can make additional changes to the CanonicalUrl class.
Revised to use HtmlTextWriter instead of just output, and to exit if there is no context item.