Move optimized pin detection code to Board class.
Remove unused isPinned variant from Board.