Merged in some non-Sitecore 7 changes from the sitecore-v7 branch so that Paul can make additional changes to the CanonicalUrl class.