Travis fix, unit test fixes

The first commit fixes an issue with building the project on Travis CI - it failed to build because the libpcap library wasn't installed.

The remaining commits represent work on fixing unit test failures. There are still some test failures remaining, but I think they are genuine failures in the sense that they expose mismatches between the tests and the code, so they need further attention.