Move document.registerElement to end of script.