Minesweeper in JavaScript which is testable, not dependent on GUI and well structured