Add self-loop drawing

This sort of works around fkling/JSNetworkX#2

Arrowheads are not drawn on directed self-loops, because it would be
difficult to work out where to actually put the arrowhead, since we do
not have complete control over the curve coordinates.

D3 is updated to version 3, to take advantage of curve generators.