Make piping a command's output work properly

Closes #27