Rework the URI builder (#321).
Reinstate gradle manual tests.