#123: First attempt at factoring out linked stack impl.
#123, #100: Also implement getter/setter for refcount.
#123, #100: Actually use the getter/setter for refcount.
#123: Factoring out linked stack, part 2