Replaced StateStack class with generic Stack class.