Added Bits#getAndClear, Bits#getAndSet and Bits#containsAll

Also made some variables local in other methods.