Added abstract Stack class, implementing common methods and provides the core interface.