Fix #12, implement castling, complete with movehistory and every rule.