Adds Unit Tests and fixes Cart management.