This relies on object enumeration occurring in insertion order. This *will* work everywhere, I believe, but we don't need to rely on unspecified behaviour…

```coffeescript
("#{encodeURIComponent key}=#{encodeURIComponent o[key]}" \
 for key in Object.keys(o).sort()).join('&')
```