MineSweeper clone in JavaScript