more safe document context
fix 'this' problem
generation of header-id is now moved to DocumentContext