BitArray data structure for JavaScript