Refactor Grib save handling of grid templates, for clarity.

I have not changed this, it is existing code.

In any case, I don't really agree as the concepts aren't applicable to *all* templates, of course, only ones based on cylindrical projections.
The problem really is that the existing function doesn't have a clear single purpose.  In the followon, I needed to split some code out of it, and I renamed the remaining part 'latlon_grid_common'.