Fixes for Infinity and NaN

Although JSON RFC does not support NaN or Infinity
as numeric values ECMA 262 section 9.8.1 defines
how to handle these cases as strings

Change-Id: I4716ed97658b7d0e9c301a96e26abc5253e48680