Refactored pcap tests. All should pass now. Refactored other things and added more tests.