etc-update: rewrite significantly
This tool is very inefficient, especially in the case of auto-merging
with -3/-5 and such. Rewrite the code to kill off dead paths, compress
multiple greps into a single sed, cache more calculated results, and
use bash code where possible rather than execing external tools. There
are also style updates here, many of which fix quoting issues and other
such things.
The next rewrite should probably be in python, but this version is
fast enough for me now even on my slow machines.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>