Implements a general stack with a few basic stack operation methods.