Built template matrix extension with template CUDA kernels, updated Matrix classes