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.

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.
Fix Redis issue #855

Added support for events outside tasks

Added error handling

Revert "Updated json to correctly handle double and float nan"

This reverts commit 046eac11755fd08e69f94d0e0daf2908ac7faca9.

Trailing whitespace