Templatize BitArray and move it to the root folder