Reimplement context stack as a linked list.