added sub-packet handling, packet name and improved output formatting for operator<<