More refactoring of process_sankey(); no functional changes.
More refactoring of process_sankey(); no functional changes.

* Removed 'line_ix' in favor of a simpler forEach.
* Rearranged the input parsing loop to return early more often.
* Moved more variable declarations to a more limited inner scope.

nowthis/sankeymatic,nowthis/sankeymatic