Avoid conflicts with using Functions as Custom Element definitions

Function.name is readonly, use defition.elementName to store tagname
Add test
Fixes #362