Add Bitmask class

The Bitmask class makes it easy to modify bitmasks (add or remove values) and to check if a bitmask includes a specific value.
Use the Bitmask class in ErrorReporting