New helper function 'state_text'

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>