Major rewrite of packetsender functions

The saving of packets is very buggy, needs fixing