load: add test for pcapng, tidy up code a bit