Refactor bitarray module. Add more test for new check funtcion.