RedMine 6397: rewrite SplitProcLine and clean up in its file

Long over-due clean-up and reworking.
See commit comments for explanations of the various parts of the whole.

For 3.6.x, the "RedMine 6397 mitigation" commit is enough to fix Solaris's problems.
Ah, doh, of course it can't because of comparison with ``outer``. Sorry, it's easy to get lost in this parsing logic!