Redo ST_Graph to fix OutOfMemoryExceptions

When running ST_Graph on a table with over 1 million edges, I was getting
`OutOfMemoryException`s. To fix this problem, I redid `ST_Graph` in pure SQL.

Note that the ordering of nodes is a little different than before.  We assign
ids first to all the first points of the first geometry of each geometry, then
to all the last points of the last geometry of each geometry.

A big thanks to @nicolas-f for helping me work out this script. It was his idea.

Cf. #225 for performance.