Serialize keys using JSON.serialize

uri.format() is a bad choice for serialization when non-standard
properties are tacked on (and when .query properties aren't also
included in path)
Merge pull request #87 from mojodna/improved-key-generation

Serialize keys using JSON.serialize