Enhance MessageHeaderAccessor support and optimize message creation

See individual commit descriptions.