Fixing custom element feature detection
Moving initialize code out of event handler