doubly-linked lists in Lua