Cherry pick high speed checksum functions from msantos/pkt

The new version seems to be about twice as fast as the old one.

This also adds unit tests. The old version passes all tests except for `makesum_1`.