Revert "Revert "Revert "Revert "Revert "Revert "Revert "Improved flatten and usage of memory in SELECT by using iterators rather than collections"""""""

This reverts commit ed5aa8d53111ccd26f99c75a148698587d074c15.
Revert "Revert "Improved flatten and usage of memory in SELECT by using iterators rather than collections""

This reverts commit fe77b5d5ba92f046f955b7627f9b50f4218a5858.
Merge branch 'master' of https://github.com/nuvolabase/orientdb