Minor clarifying updates to stock_stats
Removed some mutable state in pipeline construction
Make end_piece stateless