Cleaned up my implementation of pipewrite and piperead based on
commentary in class. No slower, but it does avoid the duplicated code
issue. Also, added some comments for good measure.