Started stack implementation

I figured I might as well make it work for the queues too, since they're
coming up in this part as well. I think I have the head and tail
behavior turned around, though.