add ability to unset bit

Currently setbit only allows setting a bit to 1 but not the other way around. OR bitwise operation was changed to XOR to support this.