Replace string type with graph.Direction

This improves type safety, memory consumption and, with high probability, performance.

This conversion is not complete as there are still uses of string directions via the Direction.String method in leveldb. An initial attempt at this failed, so it will come in a later PR and is marked with a TODO.