Created a _calculate_scale_factor function in templates.py to be used in the new ValueOf* set functions.
Added set functions to all the ValueOf classes that behind the scenes use the ScaledValue and ScaleFactor* setters.
Changed the ValueOfget to behind the scenes use the ScaledValue and ScaleFactor*
Fixed the LeadTime set for messages that are an accumulating statistic to set both LeadTime to the beginning of the accumulating period and the accumulating end date to the appropriate parts of section4.
Now when writing with to_grib2 the messages will be sorted, if writing from a DataSet will sort on shortName, then for each DataArray will sort on dimension names, then sort dimension values.