optimized reference-related WQL

now follows join pattern (instead of IN (<subselect>) )
This improves the handling of missing (see comment above).  Still need tests to demonstrate that...