Initial implementation of ios_base and streambuf, with tests