chess-search-position: Move castling check for rooks out of the direction loop.
chess-search-position: 20% performance improvement by treating ray pieces commonly.

When we search for pieces of a certain color, we iterate over all results
from all pieces of that color.  However, this is redunant as we end up
to check the compass rose twice, once for bishops/rooks and once for queens.
We actually just need to check all 8 directions once and keep a list of
what piece type can move in which direction.