Simple Minesweeper in JavaScript, originally created as a Stack Snippet