Set document's URL from JSON document's canonical_url

An earlier commit was getting the URL from where the document was
loaded from.  This caused problems when the document was loaded
directly via JSON instead of from a URL endpoint.