Organize protocol code a bit
Add missing url parser