tools lib: Add bitmap_and function