Fix #16: Templates not deepcopyable

Support deep copying Template instances.