Made class Cart and function to it.

class Cart has been and many function has been added to it. Comments are provided for better understanding. Further function are to be added.