Tweaks to Template registration feature

@clarle here are some tweaks to yui/yui3#1026