Cleaned up the packetsender code

Also huge thanks to the creator of nana for helping me out with a layout
issue