Adds support for serializing/deserializing infinity floats and doubles

Currently Double and Float infinity values are serialized as `Infinity`, which is illegal according to the json specification. This causes any deserialization to blow up. 
This change explicitly serializes infinity values to a preset large value which is always deserialized as Infinity.