Handling default attributes for node/edge/graph statements

I saw this was a feature request for dig.js and implemented it for dagre.

--

Default attributes apply to all statements following them:
  digraph G {
    n0 [label="colorless node"]
    node [color=green font=Helvetica];
    n1 [label="green node"]; /* color=green and font"Helvetica are added automatically */
  }

Multiple default attribute statements are merged, and newer attributes have
precedence over older attributes:
  digraph G {
    node [color=green font=Helvetica];
    node [color=yellow];
    n0 [label="yellow node"]; /* font=Helvetica is added automatically */
  }