Optimize mask creation utilities

This introduces a simpified fillBitMask(), which is much simpler to use
and also much faster.

Change-Id: I5519032e3a83a3ace73c1b383784b1e372870782
Signed-off-by: Robert Varga <rovarga@cisco.com>