Packet handling update

Removed the messy packet handling method, added cleaner version. Cleaned
up level handling (thanks to diesieben07 for the tips)