Metatables need to be deep-copied

The metatables in the template instantiation functions (e.g. VectorT)
were shallow-copied.  The held type information (_ct_size) was getting
blown out by multiple template instantiations!!
micro-optimizations based on -jv feedback

mostly eliminating locals, hoisting loop invariants, and some function calls