reuse templateId in basis.template.tmpl.Template#builder
use number for templateId instead of strings, limit template count to 4096
remove tmpl.setByRef method, tweak tmpl#set to work as setByRef
remove updateAttach closure
move template sync with object from createInstance, move tools function inline from createInstance to createInstance factory