libtools: bitmap types and clear/set operations