move the uniform loading code for matrices to the programme template; modify the matrix code to allow initialisation from arbitrary matrix sizes