Cart: Improve support for line item discounts.

Ping @adamvoncorswant @softarn