Updated json to correctly handle double and float nan

Previously a double nan was serializing to the string "nan" which is invalid JSON.

Updated to use undefined instead of nan for both serializing and deserializing.

Rationale:

ECMA-262 states "The undefined value is [...] used when a variable has not been assigned a value", while "The null value [...] represents the null, empty or non-existent reference."

While I was at it, cleaned up incorrect grammar and spelling mistakes.
Merge pull request #860 from intrica/fix-json-nan

Updated json to correctly handle double and float nan