Make templates more generic, so we can use vectors etc. as well as
arrays.