Refactor: Make `uri_to_remote` more declarative
Refactor: Make `uri_to_remote` more declarative

The function was getting rather long so I decided to refactor it before
adding the new remote type `X11Remote`.  This is more declarative.

LewisHaley/stb-tester,martynjarvis/stb-tester,stb-tester/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,wmanley/stb-tester,martynjarvis/stb-tester,LewisHaley/stb-tester,stb-tester/stb-tester,stb-tester/stb-tester,wmanley/stb-tester,wmanley/stb-tester,martynjarvis/stb-tester,martynjarvis/stb-tester,stb-tester/stb-tester,LewisHaley/stb-tester,martynjarvis/stb-tester,LewisHaley/stb-tester,martynjarvis/stb-tester,wmanley/stb-tester,martynjarvis/stb-tester,LewisHaley/stb-tester,wmanley/stb-tester