Reduce the size and complexity of pipe. Add pipe tests.

- Add tests for pipe to make sure its working in all future versions.
- Add two new events, `pipe.event` and `pipe.listener`.