Add context manager to NetCDFFactory