Setting / unsetting IFS variables can be removed by setting it only
in the loop context.
The for cat can be replaced by a simpler while read loop.
Proper variable quoting was added.
Changed the way modif was optionally passed, this removes the
extraneous ':' at the end.
echo(1) the lines as we go instead of building an array, this removes
the possibility of sub-shell screwups.