dsputil_template: Move bits that are used templatized into separate file