converting infinity and NaN to null for JSON compatibility in the jqplot plot writer