improved stdin/stdout buffering

- stdin is now line buffered
- stdout can be line buffered via --line-buffered option