bs: Categorize some fields of the bytestream handler into a buffer handler.
bs: Avoid using ftell() as much as possible.