Allow Ronja to handle pattern predicates

A LogicalPlan now has a `solved` field, that indicates the
corresponding QueryGraph that the plan solves.

QueryGraph now only exists in one version - the difference
between Optional and mandatory patterns is seen by where
the QueryGraph is used and not by a different type.