Castling logic
Added the bulk of castling logic. The user interface to actually make a castling move
has not been completed yet though.