Some refactoring of process-line to speed things up.

Now we're down to 4 minutes for 1 000 000 rows so improving at least.