Use std::bitset instead of our home-grown solution

Much better.

Suggested by Lucas.

No functional change.