Implement saving and loading grid state