Add message flag codes and basic query answering on struct-level.