Properly parent dummy nodes for self loops

This change sets the parent for dummy nodes in a self loop to the parent
of the incident node. It also adds a test that was failing for self
loops prior to this change.

Lastly, we move normalize ranks because its previous position would
break the alignment we set up and cause extra dummy nodes to be created.

This change does not get self loops working under all conditions. For
example, the following graph still fails:

    digraph {
      subgraph 1 {
        A -> A
      }
      subgraph 2 {
        B
      }
    }

In this case the border node for subgraph 2 comes between A and its
dummy nodes, leading to the create of second order dummy nodes. We don't
currently handle these second order dummy nodes properly during edge
restoration.