More complete URL handling and tests.