Add some unit tests for the portsrange code

Note that none of them passes, showing that the code is badly broken.
Improve encapsulation of modules

The problem: I want to write a unit test for the functions in
portsrange.c. If the project is configured with --enable-debug, then the
code in portsrange.c depends on the ncprint and debug_fmt functions
which are defined in misc.c. However, misc.c depends on stuff in
netcat.c. On the other hand, netcat.o can't be linked into the unit test
executable because it contains the main function.

The solution: Move the ncprint and debug_fmt functions to a separate
file (ncprint.c) and ensure that it is completely self-contained. In
that case, it is enough to link ncprint.o together with portsrange.o
into the test executable.

Required changes:
* Rename misc.h to ncprint.h (mish.h only contained stuff relevant for
the two functions moved to ncprint.c).
* Make opt_debug and opt_verbose static variables in ncprint.c and
define new functions to set them.
Fix an incorrect portsrange test case
Fix the algorithms for port range calculations

Increased unit test coverage of the functions in portsrange.c and fixed
multiple bugs.

Main changes:
* An empty range is now represented as NULL instead of a range with
first and last port set to 0. This implies that the argument type for
netcat_ports_insert changes from nc_ports_t to nc_ports_t*. It also
implies that the netcat_ports_init function disappears.
* In nc_ports_st, represent the range as [start,end[ instead of
[first,last] which is more natural from a programming perspective.
Add missing license headers
Merge branch 'check'