Dylan Smith : d3dxof: Factor out parse template loops into a function.