Lots of small performance improvements

Packet packaging improved in Khaan
redundant code removed from login and gateway and now a simple interface
that most of the code uses when creating fruitidens-like interfaces.