add delegateEvents and undelegateEvents overrides + tests
refactor ensureElement