Move URL manipulation functions to CatHTTP