Do not serialize Infinity in JSON

Wherever we are serializing to JSON in core package we should set allow_nan to assure that we are really standards compliant.

See: https://gitlab.datadrivendiscovery.org/jpl/primitives_repo/issues/173