+ some refactoring in BitArray
+ added test for BitArray