fsharp/FSharp.Data — pull request #234 by ovatsus (2013-10-22 22:42:28+00:00)
Title: Refactored Json conversions to share more logic with Csv and Xml

* Previously, the Json optional properties used JsonRuntime.ConvertOptionalProperty on top of the base case of non-optional properties. Now it's the other way around : all conversions return optionals, and for non optional properties we call JsonGetNonOptionalValue
* Separated Conversions into TextConversions and JsonConversions
* Separated out ConversionsGenerator from Helpers
* Replaced some untyped quotations by typed quotations
* Prevent operations being done twice. Eg, previously was "Operations.GetNonOptionalValue("Attribute surname", Operations.ConvertString(XmlOperations.TryGetAttribute(this, "surname")), XmlOperations.TryGetAttribute(this, "surname"))" now it's "let value = XmlOperations.TryGetAttribute(this, "surname") in CommonRuntime.GetNonOptionalValue("Attribute surname", CommonRuntime.ConvertString(value), value)"
* Remove unneeded json packing followed by unpacking right after it
* When a double is missing, return NaN instead of raising an exception
* When a string is missing, return "" instead of raising an exception
* Always return "" in JsonValue.AsString(), never null (to be consistent with Xml and Csv, and to be more inline with F# general practice)
* Csv headers with just whitespace were not getting set as ColumnX