Use URI class over manual string manipulation (#1641)

Avoid building URIs manually with brittle strings. This also makes it
more clear that the Observatory URI is embedding a path and query string
into the fragment, instead of letting it look like part of the URI
itself.

Pull out `serverUri` as a separate variable and use `!` immediately. If
a null shows up this would be a more clear failure than trying to later
treat the string`'null'` as a URI.
1 file changed