Rewrite some bitboard init code