Update support for CustomElements: change document.register to document.registerElement; entered/leftViewCallbacks to attached/detachedCallbacks