[BUGFIX] (Persistence): Implement deferred loading in Doctrine\QueryResult
Until now, Doctrine\QueryResult got all results passed into the constructor.
This change modifies the behavior such that queries are executed lazily, on first
access of the QueryResult object, leading to a big performance gain when dealing
with many objects.
Furthermore, cloned Query objects were still connected to the original instance,
as they shared the same QueryBuilder. This has been fixed as well.
Additionally, deserializing simple queries without a constraint now also works
properly. Before, this case lead to incomplete DQL, resulting in a Doctrine error.
All of the above is covered with Functional Tests.