Added io module
Implemented stream and toBuffer