Improved TLV debugging

[channels, logging, tlv]
- improved TLV debugging

[pbuffer]
- only move buffer to front when there is enough space