separate set/clr functions
more internals
implement alloc_tds with full chain support