Introduce optimized recursive Graph-Stmt

Use a modified Version of the graph-data
query statement. Instead of looping
through by ourselves we use the PostgreSQL
recursive WITH Query to let the database do this for us

This increases the initial cost of the query but it scales
much more nicely when performing queries on much more
complex data or with a much bigger depth.
remove obsolete parts and make recursive default.
Determine GraphData cost for functions too

Although this might not be as useful, since
the calculated cost of functions is not such
a useful indicator for their cpu-cost.
add graph data function as a PostgreSQL function.
use compiled function for fetching graph data.
Merge branch 'staging' into optimize_complex_sql
Merge pull request #651 from ontohub/optimize_complex_sql

Optimize complex sql