Implemented sub query expression resolving and tests, refactored unresolved variable finder from variable resolver, restructured function expression tree, better exceptions for control structures in query function, more misc tests and bugfixes