Make safe copy of buffer as the buffer is released after it is processed
Fix message type detection
Make sure we not access a freed buffer in tests
Cleanup
Fix logic to match Netty 4
Cleanup a bit