make compatible with jQuery
Move low level circular structure detection logic to Item