Capitalize Script in JavaScript
Implement the threefold repetition rule

Chess.Position stores an array of past Zobrist hash keys.
isThreefoldRepetitionRuleDraw can then count the number of times the
current position has repeated.