Partially implemented BitStream class - only write() so far.