ENH: unroll correlate loops

Unrolling the inner loop ensures the kernel is placed into registers and
reused, this almost doubles performance.
Also move the function to arraytypes.c.src where also our dot product is
placed.
The templ_common.h might still be useful in future so its kept.