Be standards compliant when dealing with JSON serialization of NaN and Inf floats

Patch by dahla
Merge pull request #2 from openmetaversefoundation/master

Pulling latest changes