Support several output formats in state_graph tool

This commit adds -T aka --format option to state graph tool that
can be used to specify output format. Supported values are 'dot',
'svg', 'svgz' and 'png'.

Change-Id: I27a74b582726da24a1b05d4ffb72bde860fff417