Added LinkedItemChain class. Added some helper functions.
Using separate DEBUG_LINKED_ITEM_CHAIN flag for linked items.