Pure Ruby bit array/bitfield implementation