Previously, _out_degree and _in_degree were used to maintain a doubly-
linked list of deleted nodes (so that we could easily use them first
when making new nodes).

_out_degree gave the next node index and _in_degree gave the previous.

But there is no need to have this list be double-linked.  _out_degree
is enough.  So let's not use _in_degree to this end.
Move tests to their own file.
Let the graph class support undirected graphs. This property is
maintained as a Boolean variable.

In general, the same code paths can be used for both directed and
undirected graphs and things will work as expected. For example,
g.out_nodes(0) will give all neighbours in the case of undirected
graphs and only out-neighbours in the case of directed graphs.
Make the default to be an undirected graph. Also just call the class
Graph.
Fix method to work with undirected graphs.
Don't mix debugging code with main code.
Change edge representation.

Previously, an edge was represented as (target node, position of
target node in out edge list of source). Now it is
(source node, position of source node in in edge list of target).

Why the change? Well, we plan on representing edge properties
just as we do the self._out_nodes (i.e. a list of lists). With
the new edge encoding, an edge can directly be used to index
into a property list whose layout matches that of self._out_nodes
but which contains the property instead of the node index.

We insist on following self._out_nodes and not self._in_nodes
because we mostly enumerate things in order of _out_nodes and
this scheme is better from a CPU cache point of view.