use encodeURI[Component]() and decodeURIComponent() from httpuv

For review only. Please do not merge until the new version of httpuv is released to CRAN.