Adds JSON serialization in Float class.

Handles NaN and infinity properly.