Added castling and basic attack checking.