Add packet encoding

Add packet encoding, fix decoding memory allocation, create player class
stub