Refactored output redirections to implement pipes; around 70% there.