bitarray: less unpackings, fix return types, more testing