Use RFC 3986 compatible URL encoding

Fixes #5