Refactored to put all grid logic into seperate file, main now only deals with NetCDF
Part 2 of previous commit