Added Piece.movedTo method.
Removed redundant check if the king has moved when castling.
Checks if a move is valid by checking it against the list of generated moves.