url-hexify values in key-value pairs

Fixes an issue found in #129 and is based on that branch, so that must be merged first.