[YoutubeDL/utils] Clarify rationale for URL escaping in comment, move escape routines to utils and add some tests