copy from ex7
Basic support for selections of intersections. One trustme.

Also for better query support:
- Added explicit output type to arrow and lam.
- Reversed order of pev reqs.