6bac69a first draft at translating chess.js