Improved generic URI interface & tests.