Added a utility method for parsing double values from json (to handle
nan/inf)