Enhances ability of extensions to customize line items and the entire cart composition process.

Fixes #5087