Function for checking if a player is mated.
Add bounds checking in checkmate.

Got weird bugs popping up in checking if the king could move out of
check, which seem to have been caused by the king moving off the board.
Add OTHER_PLAYER macro.

Beats typing p == WHITE ? BLACK : WHITE a million times.