Minesweeper in JavaScript