Adding unit tests for grid.
Added input checks to Grid.__init__