Convert javascript state machine to DOT graph