Remove unnecessary 'tabrepl' var

'tabrepl' is used only once, no need for a dedicated variable.
Remove unnecessary var assignment

The expression is only used and calculated once in every loop, no need
to use a dedicated variable holding it.
Declare variables before the loop
Extract to 'diff_hunk()' function

https://bugzilla.gnome.org/show_bug.cgi?id=720886
Extract to 'exec_template' function

https://bugzilla.gnome.org/show_bug.cgi?id=720886
Move the wrapped html into template

https://bugzilla.gnome.org/show_bug.cgi?id=720886
Replace 'FILE_BODY' at the end

It rarely happens, if 'FILE_BODY' contains placeholders, it has to be
the last placeholder to be replaced.

https://bugzilla.gnome.org/show_bug.cgi?id=720886