Refactor set/getCellCorn() with private method.

Also const-ify everything that can be const.