NaN and infinite number JSON serialization.

Adds JSON serialization for NaN and infinity in Float class.