Add basic packet handling class

For whenever packets stop giving me headaches (or whenever I need them).
Tons of (broken) code

Added and tweaked lots of code. However, most of the added code is
broken or useless. I'll have another go tomorrow... unless someone sees
this and helps...