Merge Revert to using popcount to count the number of pieces, since

pos.count<ALL_PIECES>() does not work.