Ensure connect callback is invoked on premature socket hangup

Closes #534
Add unit test for callback on early postgresql disconnect

Test adapted by that provided by Jess Sheneberger in #534
Enable the test for #534 (needs special naming)

This time, I hope, travis will confirm that the fix works with
node-0.10 but not with node-0.8
Have Connection also emit 'end' on stream 'close' event

Should fix missing connect callback call with node-0.8 (#534)
benchmark value preparation
utils-tests: add unit tests for prepareValue
utils: reorganize prepareValue conditional for clarity

Prefer positive tests; group tests for specific objects.
utils: convert tabs to spaces
properly prepare complex arrays

`arrayString` duplicated too much of `prepareValue`'s logic, and so
didn't receive bugfixes for handling dates with timestamps. Defer to
`prepareValue` whenever possible.

This change enforces double-quote escaping of all array elements,
regardless of whether escaping is necessary. This has the side-effect of
properly escaping JSON arrays.
allow type-coercion overrides for custom objects

Attempt to call a `toPostgres` method on objects passed as query values
before converting them to JSON. This allows custom types to convert
themselves to the appropriate PostgreSQL literal.

This strategy is fully backwards-compatible and uses the same pattern as
the `toJSON` override.
pass `prepareValue` hook to `toPostgres`

Pass `toPostgres` type-coercers a reference to the `prepareValue`
function to ease constructing literals composed of other Postgres types.
Do not emit 'end' twice from Connection on close
Have stream emit 'close' rather than 'end' for sake of testing
Merge pull request #555 from benesch/custom-type-coercion

Supercharge `prepareValue`
Merge pull request #546 from CartoDB/2.11-ensure-connect-callback

Ensure connect callback is invoked on premature socket hangup
Merge pull request #558 from hoegaarden/master

upgrade pgpass
Remove query emit 'end' event when query has error

Closes #547
Update news
Update changelog
Bump version