Update support for CustomElements to use document.registerElement

change document.register to document.registerElement
change entered/leftViewCallbacks to attached/detachedCallbacks