Further refactoring to seperate ncdf4 from the rest of the package.