Progress on generic URI encoding. Relates to #1.