optimized reference-related WQL

now follows join pattern (instead of IN (<subselect>) )
WQL has never had any key-based reference queries but probably should at some point.