fix($http): fix double-quoted date issue when encoding params

$http was wrapping dates in double quotes leading to query strings like this:
  ?date=%222014-07-07T23:00:00.000Z%22
Instead of calling JSON.stringify, this fix checks to see if a param object
has a toJSON() function and uses that for encoding, falling back to
JSON.stringify as per the previous behaviour.

Closes #8150 and #6128