change name of array_state to submessage state
increase counter only for submessages
change name of array_state type to submessage type
update macro to match new name
add support for submessages