I'm committing these changes before undoing these, and coding it properly.
I need to re-add the lua hooks, but it'll be easy.
Since the contents of the packets are different than before, I decided to gut the serialization code. I'll reimplement the internals soon.