Convert graph JSON-parsing tests to new graph structure
Enforce edge directions and types for rules

Rule.mk now checks that inputs correspond to inputs, outputs to outputs,
undirected boundaries to undirected boundaries, and that the relevant
edge types match up.  Isolated points are also prohibited (which ensures
normalisation won't change the boundary).

Tests for this are now included, which all use the new test graph type.