More robust URL splitting/snipping. Tests now passing.