Basic stream-based I/O impl

See #54
Cleaning
Formatting