[refactor] make bitmasks closer to a real type

While the current bitmask management is heavily inspired by libnuma, it is not
as easy to use has the libnuma API. This patch is an attempt to refactor
to code towards something cleaner.
3 jobs for bitmap-api in 18 minutes and 44 seconds
Status Job ID Name Coverage
  Build
passed #28638
make:generic

00:09:38

passed #28639
make:knl

00:09:03

passed #28637
repoquality

00:04:44