Core implementation of Minesweeper game.

Independent from any view class.