Add URI encode/decode functions

cc @yihui