refactor url_replace, add unicode tests