Add a WIDTH parameter to BIT_MASK().

This commit adds WIDTH, which specifies the amount of bits to be set in
the resulting mask.