added function for saving grid definitions to netCDF, including tests.

Wrote test for latlon2cell