Add PipelineItem.

- PipelineItem is a container for items that traverse the pipeline.
- It can have an arbitrary number of arbitrary payloads.
- Also did some code cleanup.