Improve performance of ST_Graph

Using PreparedStatements greatly increases the efficiency of ST_Graph. For a table with ~14,600 entries, we pass from 14 seconds to about 2 seconds.