Tests: URL-encode query strings

Keys and values need to be URL-encoded when generating query strings.
This has not been necessary until now because no special characters have
been used, but it will be necessary in future versions.

Add 'buildQuery' for encoding a query string from a 'QueryLike', and use
it in place of manual 'ByteString' manipulation.

Turn 'AttributeKey' and 'AttributeValue' type synonyms into 'newtype's,
and make them instances of 'QueryKeyLike' / 'QueryValueLike' so that
they can be used with 'buildQuery', replacing the 'buildAttribute'
function. Use GeneralizedNewtypeDeriving to generate instance
declarations for 'IsString', 'Stringable' and 'QueryValueLike'.

Require the stringable package for the 'Stringable' class.

Signed-off-by: Stian Ellingsen    <stian@plaimi.net>
Reviewed-by:   Alexander Berntsen <alexander@plaimi.net>
Signed-off-by: Alexander Berntsen <alexander@plaimi.net>