Added functions to send custom packets

SendLosslessPacket doesn't work yet for some reason
Some work on events for custom packets
Merged from master and fixed conflicts
Packet events should work as well now