Improving templating of CoGLSim.h