Improve pipe example to work with buffered output. Closes #48.