Refactored and added simple log parsing support
Fixed payloadLength bug in the packet parser.

Wrong size assigment when payload was supplied as an argument.