Tidy up the packet system a little.
Made it clearer what packet does what and removed some repeated code. Should be much easier for future expansion!