Make ncm-shorewall work on SL6.

There were lots of warnings and wrong constructions that made the component misbehave on Perl > 5.10.

In the first commits I refactored all the internal functions so that I could understand the code a bit better.  Then, I've fixed the SL6-related warnings.

I didn't improve the code or use CAF::* for anything.  This is just a blind fix for SL6.  The code is still "not pretty".