handle duplicate keys

Handle duplicate keys correctly, e.g. the same way that the request module does it (should fix #1)
Array.isArray doesn't work in IE8 afaik.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray