Replace chessboard DOM manipulation in code to declarative template in HTML.